<%
# Copyright (C) 2012 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<%
   account_notification ||= nil
   notification = account_notification
%>
<div class="ic-notification ic-notification--admin-created ic-notification--<%= notification_container_classname(notification) %> account_notification">
  <div class="ic-notification__icon" role="presentation">
    <i class="<%= notification_icon_classname(notification) %>"></i>
    <span class="screenreader-only">
      <%= accessible_message_icon_text(notification_icon_type(notification)) %>
    </span>
  </div>

<div class="notification_account_content">
  <div class="ic-notification__content">
    <div class="ic-notification__message">
      <h4 class="ic-notification__title">
        <%= notification.subject %>
      </h4>
      <% # I don't see a problem with using gsub given that there are only potential substitutions %>
      <% # but if you found this comment while looking to add a third, it might be time to consider being smarter about this :p %>
      <span class="notification_message">
      <%= user_content(notification.message.gsub(/(({{)|(%7B%7B))ACCOUNT_DOMAIN((}})|(%7D%7D))/,request.host_with_port).gsub(/(({{)|(%7B%7B))CANVAS_USER_ID((}})|(%7D%7D))/,@current_user.global_id.to_s)) unless notification.message.nil? %>
      </span>
    </div>
    <div class="ic-notification__actions">
      <a href="#" class="Button Button--icon-action" data-url="<%= dashboard_close_notification_path(notification.id) %>" data-remove=".ic-notification" title="<%= t :close, 'close' %>" role="button">
        <i class="icon-x"></i>
        
      </a>
    </div>
  </div>
  <span class="notification_account_content_text">
    <%= t("This is a message for *%{name}*", name: notification.account.name, wrapper: '<b>\1</b>') %>
  </span>
</div>

</div>
